#include "CropWidget.h"
#include <QPainter>

CropWidget::CropWidget(QWidget *parent)
	: QMainWindow(parent)
{
	ui.setupUi(this);

	setAttribute(Qt::WA_TranslucentBackground, true);
	setWindowFlags( Qt::FramelessWindowHint);
}

CropWidget::~CropWidget()
{}

void CropWidget::paintEvent(QPaintEvent *event)
{
	int iwidth = this->width() - 4;
	int iheight = this->height() - 4;

	QRect rect(2, 2, iwidth, iheight);
	QPainter painter(this);
	//painter.setPen(Qt::NoPen);
	//painter.setBrush(Qt::magenta);
	//painter.drawRoundedRect(this->rect(), 5, 5);

	painter.setCompositionMode(QPainter::CompositionMode_Clear);
	painter.fillRect(rect, Qt::SolidPattern);
}
